package com.gitee.cui.springcloud.controller;

import javax.annotation.Resource;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * TODO
 *
 * @author cuiqingqiang
 * @version 1.0
 * @date 2022-03-05 17:09
 **/
@RestController
@Slf4j
@RequestMapping(value = "/consumer")
public class OrderConsulController {

	public static final String INVOKE_URL = "http://cloud-providerconsul-payment";

	@Resource
	private RestTemplate restTemplate;

	@GetMapping(value = "/payment/consul")
	public String consulInfo() {
		return restTemplate.getForObject(INVOKE_URL + "/payment/consul", String.class);
	}
}
